﻿using System;
using System.Collections.Generic;
using XLua;
using BestHTTP;
namespace StarForce
{
    [LuaCallCSharp]
    public class BestHttpUtil
    {
        public static void Get(string url)
        {
            new HTTPRequest(new Uri(url),HTTPMethods.Get).Send();
        }
        
        public static void Get(string url,OnRequestFinishedDelegate callback)
        {
            new HTTPRequest(new Uri(url),HTTPMethods.Get,callback).Send();
        }
        
        public static void Post(string url,OnRequestFinishedDelegate callback)
        {
            new HTTPRequest(new Uri(url),HTTPMethods.Post,callback).Send();
        }
        
        // public static void Post(string url,Dictionary<string,string> param,OnRequestFinishedDelegate callback)
        // {
        //     HTTPRequest request = new HTTPRequest(new Uri(url),HTTPMethods.Post,callback);
        //     request.AddField();
        //     request.Send();
        // }
    }
}